package didispace.service;

import didispace.mapper.UserMapper;
import didispace.module.UsersEntity;
import didispace.utils.MD5Util;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserService {

@Resource
private UserMapper userMapper;


  public List<UsersEntity> getUserList(UsersEntity usersEntity){

    List<UsersEntity>  userList = userMapper.getList(usersEntity);
    return userList;
  }

  public UsersEntity userLogin(String u_acount, String u_password){
    String u_passwordMd5 = MD5Util.stringMD5(u_password);
    UsersEntity usersEntity = userMapper.userLogin(u_acount,u_passwordMd5);
    if (usersEntity!=null){
      return usersEntity;
    }else{
      return null;
    }

  }

}
